package com.jh.user.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import org.hibernate.validator.constraints.NotBlank;

import javax.persistence.Column;
import java.io.Serializable;
import java.util.Objects;

public class ChannelRequest implements Serializable {
    private static final long serialVersionUID = 1L;

    /** 渠道标识 */
    @NotBlank(message = "渠道标识不能为空！")
    private String channelTag;

    /** 通道备注 */
    @NotBlank(message = "通道备注不能为空！")
    private String remarks;

    /** 传到渠道的参数, 集成的商家类的 */
    @NotBlank(message = "渠道参数不能为空！")
    private String channelParams = "D0";

    /** 渠道商家标号 */
    @NotBlank(message = "渠道商家标号不能为空！")
    private String channelNo;

    /** 是否自动清算 */
    @NotBlank(message = "渠道自清不能为空！")
    private String autoclearing = "0";

    /** 通道类型 0 表示 T+0 1表示 T+1 2表示 D+0 3表示 D+1 */
    @NotBlank(message = "渠道类型不能为空！")
    private String channelType;

    /** 渠道名字 */
    @NotBlank(message = "渠道名称不能为空！")
    private String name;

    /** 子渠道标识 */
    @NotBlank(message = "子渠道标识不能为空！")
    private String subChannelTag;

    /** 子渠道名字 */
    @NotBlank(message = "子渠道名称不能为空！")
    private String subName;

    /** 单次最低限额 */
    @NotBlank(message = "单次最低限额不能为空！")
    private String singleMinLimit;

    /** 单次最高额度 */
    @NotBlank(message = "单次最低限额不能为空！")
    private String singleMaxLimit;

    /** 成本提现费 */
    @NotBlank(message = "成本提现费不能为空！")
    private String minwithdrawFee;

    /** 成本额外费用 */
    @NotBlank(message = "成本额外费用不能为空！")
    private String minextrafee ;

    /** 通道开始可以使用的时间 */
    @NotBlank(message = "通道开放时间不能为空！")
    @JsonFormat(pattern = "HH:mm:ss")
    private String startTime;

    /** 通道结算的时间 **/
    @NotBlank(message = "通道关闭时间不能为空！")
    @JsonFormat(pattern = "HH:mm:ss")
    private String endTime;

    /** 成本费率 */
    @NotBlank(message = "成本费率不能为空！")
    private String costRate;

    /** 通道状态0:关闭；1：正常使用；2：试运营 */
    @NotBlank(message = "渠道状态不能为空！")
    private String status = "1";

    /**通道商户类型 1落地商户，2线上商户*/
    @Column(name = "channel_mer_type")
    private String channelMerType;

    public String getChannelTag() {
        return channelTag;
    }

    public void setChannelTag(String channelTag) {
        this.channelTag = channelTag;
    }

    public String getRemarks() {
        return remarks;
    }

    public void setRemarks(String remarks) {
        this.remarks = remarks;
    }

    public String getChannelParams() {
        return channelParams;
    }

    public void setChannelParams(String channelParams) {
        this.channelParams = channelParams;
    }

    public String getChannelNo() {
        return channelNo;
    }

    public void setChannelNo(String channelNo) {
        this.channelNo = channelNo;
    }

    public String getAutoclearing() {
        return autoclearing;
    }

    public void setAutoclearing(String autoclearing) {
        this.autoclearing = autoclearing;
    }

    public String getChannelType() {
        return channelType;
    }

    public void setChannelType(String channelType) {
        this.channelType = channelType;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSubChannelTag() {
        return subChannelTag;
    }

    public void setSubChannelTag(String subChannelTag) {
        this.subChannelTag = subChannelTag;
    }

    public String getSubName() {
        return subName;
    }

    public void setSubName(String subName) {
        this.subName = subName;
    }

    public String getSingleMinLimit() {
        return singleMinLimit;
    }

    public void setSingleMinLimit(String singleMinLimit) {
        this.singleMinLimit = singleMinLimit;
    }

    public String getSingleMaxLimit() {
        return singleMaxLimit;
    }

    public void setSingleMaxLimit(String singleMaxLimit) {
        this.singleMaxLimit = singleMaxLimit;
    }

    public String getMinwithdrawFee() {
        return minwithdrawFee;
    }

    public void setMinwithdrawFee(String minwithdrawFee) {
        this.minwithdrawFee = minwithdrawFee;
    }

    public String getMinextrafee() {
        return minextrafee;
    }

    public void setMinextrafee(String minextrafee) {
        this.minextrafee = minextrafee;
    }

    public String getStartTime() {
        return startTime;
    }

    public void setStartTime(String startTime) {
        this.startTime = startTime;
    }

    public String getEndTime() {
        return endTime;
    }

    public void setEndTime(String endTime) {
        this.endTime = endTime;
    }

    public String getCostRate() {
        return costRate;
    }

    public void setCostRate(String costRate) {
        this.costRate = costRate;
    }

    public String getStatus() {
        return status;
    }

    public void setStatus(String status) {
        this.status = status;
    }

    public String getChannelMerType() {
        return channelMerType;
    }

    public void setChannelMerType(String channelMerType) {
        this.channelMerType = channelMerType;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (!(o instanceof ChannelRequest)) return false;
        ChannelRequest that = (ChannelRequest) o;
        return Objects.equals(getChannelTag(), that.getChannelTag()) &&
                Objects.equals(getRemarks(), that.getRemarks()) &&
                Objects.equals(getChannelParams(), that.getChannelParams()) &&
                Objects.equals(getChannelNo(), that.getChannelNo()) &&
                Objects.equals(getAutoclearing(), that.getAutoclearing()) &&
                Objects.equals(getChannelType(), that.getChannelType()) &&
                Objects.equals(getName(), that.getName()) &&
                Objects.equals(getSubChannelTag(), that.getSubChannelTag()) &&
                Objects.equals(getSubName(), that.getSubName()) &&
                Objects.equals(getSingleMinLimit(), that.getSingleMinLimit()) &&
                Objects.equals(getSingleMaxLimit(), that.getSingleMaxLimit()) &&
                Objects.equals(getMinwithdrawFee(), that.getMinwithdrawFee()) &&
                Objects.equals(getMinextrafee(), that.getMinextrafee()) &&
                Objects.equals(getStartTime(), that.getStartTime()) &&
                Objects.equals(getEndTime(), that.getEndTime()) &&
                Objects.equals(getCostRate(), that.getCostRate()) &&
                Objects.equals(getChannelMerType(), that.getChannelMerType()) &&
                Objects.equals(getStatus(), that.getStatus());
    }

    @Override
    public int hashCode() {
        return Objects.hash(getChannelTag(), getRemarks(), getChannelParams(), getChannelNo(), getAutoclearing(), getChannelType(), getName(), getSubChannelTag(), getSubName(), getSingleMinLimit(), getSingleMaxLimit(), getMinwithdrawFee(), getMinextrafee(), getStartTime(), getEndTime(), getCostRate(), getStatus(), getChannelMerType());
    }

    @Override
    public String toString() {
        return "ChannelRequest{" +
                "channelTag='" + channelTag + '\'' +
                ", remarks='" + remarks + '\'' +
                ", channelParams='" + channelParams + '\'' +
                ", channelNo='" + channelNo + '\'' +
                ", autoclearing='" + autoclearing + '\'' +
                ", channelType='" + channelType + '\'' +
                ", name='" + name + '\'' +
                ", subChannelTag='" + subChannelTag + '\'' +
                ", subName='" + subName + '\'' +
                ", singleMinLimit='" + singleMinLimit + '\'' +
                ", singleMaxLimit='" + singleMaxLimit + '\'' +
                ", minwithdrawFee='" + minwithdrawFee + '\'' +
                ", minextrafee='" + minextrafee + '\'' +
                ", startTime='" + startTime + '\'' +
                ", endTime='" + endTime + '\'' +
                ", costRate='" + costRate + '\'' +
                ", status='" + status + '\'' +
                ", channelMerType='" + channelMerType + '\'' +
                '}';
    }
}
